package com.godtree.service;

import java.sql.ResultSet;
import java.sql.SQLException;

import com.godtree.dao.UserDao2;

public class UserService {
UserDao2 userDao2=new UserDao2();
ResultSet resultSet=null;
public void createUser(String name,String password) {
	resultSet=userDao2.queryUser(name);
	try {
		if (resultSet.next()) {
			System.out.println("已经有该用户了");
		}
		else {
			System.out.println("还没有该用户,准备插入数据");
			userDao2.createUser(name, password);
			System.out.println("已经插入成功");
		}
	} catch (SQLException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
}

}
